#!/bin/bash

set -e
set -x
bypy download apache-zookeeper-3.7.2-bin.tar.gz
tar xf apache-zookeeper-3.7.2-bin.tar.gz -C /opt
ln -fs /opt/apache-zookeeper-3.7.2-bin /opt/zookeeper
mkdir -p /opt/zookeeper/data
cp zoo.cfg /opt/zookeeper/conf/
cp zookeeper.service /usr/lib/systemd/system/
systemctl daemon-reload
systemctl enable --now zookeeper
set +x
set +e